package com.zyx.income.tax.controller;

import com.zyx.income.tax.entity.IncomeTax;
import com.zyx.income.tax.service.RuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zyx
 * @since 2022/7/10 07:32
 */
@RestController
@RequestMapping("/rule")
public class RuleController {
    @Autowired
    private RuleService ruleService;

    @RequestMapping("/income-tax")
    public IncomeTax incomeTax(double wage){
        IncomeTax incomeTax = new IncomeTax();
        incomeTax.setWage(wage);
        incomeTax = ruleService.incomeTax(incomeTax);
        System.out.println(incomeTax);
        return incomeTax;
    }

}
